package com.ios.enums;
/**
*@Author:WenTao
*@Description:gps状态结果集
*@Date:22:06 2018/7/22
*/
public enum LocationStateEnum {

    SUCCESS_ADD(10,"成功记录gps信息")
    ,FAIL_ADD(00,"记录gps信息失败")
    ,SUCCESS_QUERY(11,"成功查询gps信息")
    ,FAIL_QUERY(01,"查询gps信息失败")
    ,NULL_PARAM(02,"参数为空或参数不完整")
    ,NULL_USER(03,"用户不存在")
    ,FAIL_ADDQUERY(04,"增加查询记录失败")
    ,SUCCESS_ADDQUERY(12,"增加查询记录成功")
    ,FAIL_QUERY_QUERY(05,"查询查询记录失败")
    ,SUCCESS_QUERY_QUERY(13,"查询查询记录成功");

    private int state;
    private String stateInfo;

    LocationStateEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    /*根据传入的state返回对应的enum值*/
    public static LocationStateEnum stateof(int state){
        for (LocationStateEnum stateEnum : values()){
            if (stateEnum.getState() == state){
                return stateEnum;
            }
        }
        return null;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }
}
